import MatchGameUtilsDataMgr from "./MatchGameUtilsDataMgr";

const { ccclass, property } = cc._decorator;

@ccclass
export default class GuideGridPrefab extends cc.Component {
    @property([cc.Node])
    particleNodes = [];

    initSide(row, col, list) {
        this.particleNodes.forEach(node => {
            node.active = true;
        });
        list.forEach(item => {
            if (item.row == row && item.col == col + 1) {
                this.particleNodes[2].active = false;
            }
            if (item.row == row && item.col == col - 1) {
                this.particleNodes[0].active = false;
            }
            if (item.row == row + 1 && item.col == col) {
                this.particleNodes[1].active = false;
            }
            if (item.row == row - 1 && item.col == col) {
                this.particleNodes[3].active = false;
            }
        });
        this.node.position = MatchGameUtilsDataMgr.getV3Pos(row, col);
    }
}
